#include "enterform.h"
#include "ui_enterform.h"
#include "commonresult.h"

EnterForm::EnterForm(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::EnterForm)
{
    ui->setupUi(this);
}

EnterForm::~EnterForm()
{
    delete ui;
}

void EnterForm::on_action_triggered()
{
}

void EnterForm::on_calc_triggered()
{
    ui->enterWidget->setEnabled(false);
    ui->calcProgress->setValue(0);
    ui->calc->setEnabled(false);
    ui->dinamic_stability->setEnabled(false);
    ui->static_stability->setEnabled(false);
    while(ui->calcProgress->maximum() > ui->calcProgress->value())
    {
        sleep(1);
        ui->calcProgress->setValue(ui->calcProgress->value() + 50);
        qApp->processEvents();
    }
    static CommonResult result("good");
    result.show();
    QPoint center(this->x() + this->width()/2, this->y() + this->height()/2);
    result.setGeometry(center.x()-150, center.y()-50, 300, 100);
}
void EnterForm::closeEvent(QCloseEvent *event)
{
    ui->calcProgress->setValue(ui->calcProgress->maximum());
}
